package sort;

public class TestSort1 {
    public static void insertSort(int[] arr){
        if(arr == null || arr.length < 2){
            return;
        }
        for (int i = 1; i < arr.length; i++) {
            int tmp = arr[i];
            int j = i;
            for (; j > 0; j--) {
                if(arr[j-1] < tmp){
                    arr[j] = arr[j-1];
                }else{
                    break;
                }
            }
            arr[j] = tmp;
        }
    }



}
